import { Rule, RuleType } from '@midwayjs/decorator'
import { ENUM_STATUS } from '../service/ticket'
export class TicketDTO {
  @Rule(RuleType.string().required())
  title: string

  @Rule(RuleType.number().required())
  ticket_source_id: number

  @Rule(RuleType.string().required())
  content: string

  @Rule(RuleType.array())
  ticket_attachments: number[]

  @Rule(RuleType.string())
  create_msg: string
}

export class TicketUpdateDTO {
  @Rule(RuleType.string())
  process_by_id: string

  @Rule(RuleType.string())
  accept_msg: string

  @Rule(RuleType.string())
  process_msg: string

  @Rule(RuleType.string().valid(
    ...Object.keys(ENUM_STATUS)
  ).required())
  status: string
}
